<% title _("Smart Proxies") %>
<%= javascript 'proxy_status' %>
<% title_actions new_link(_("Create Smart Proxy")),
                 documentation_button('4.3SmartProxies') %>

<table class="<%= table_css_classes 'table-fixed' %>">
  <thead>
    <tr>
      <th class="col-md-2"><%= sort :name, :as => s_("SmartProxy|Name") %></th>
      <th class="col-md-2 hidden-sm hidden-xs nbsp"><%= _('Locations') %></th>
      <th class="col-md-2 hidden-sm hidden-xs nbsp"><%= _('Organizations') %></th>
      <th class="col-md-3"><%= _('Features') %></th>
      <th class="col-md-1"><%= _('Status') %></th>
      <th class="col-md-1"><%= _('Actions') %></th>
    </tr>
  </thead>
  <tbody>
    <% for proxy in @smart_proxies %>
      <tr class="proxy-show" data-url="<%= ping_smart_proxy_path(proxy) %>">
        <td class="nbsp ellipsis"><%= link_to_if_authorized proxy.name, {:action => :show, :id => proxy} %></td>
        <td class="hidden-sm hidden-xs nbsp ellipsis"><%= generate_links_for(proxy.locations).html_safe %></td>
        <td class="hidden-sm hidden-xs nbsp ellipsis"><%= generate_links_for(proxy.organizations).html_safe %></td>
        <td class="ellipsis"><%= proxy.features.map(&:name).sort.to_sentence %></td>
        <td>
          <span class="proxy-show-status"><%= spinner %></span>
        </td>
        <td><%= action_buttons(*proxy_actions(proxy, authorizer)) %></td>
      </tr>
    <% end %>
  </tbody>
</table>

<%= will_paginate_with_info @smart_proxies %>
